<include file="Public/head"/>
<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <include file="Public/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>

                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <form class="form-horizontal" id="form" method="post" action="{$method}">
                        	<input type="hidden" name="id" value="{$vo['id']}"/>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 等级名称 </label>
                                <div class="col-sm-9">
                                    <input type="text" name="title" id="title" placeholder="标题"
                                           class="col-xs-10 col-sm-5" value="{$vo['title']}">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">标题不能为空。</span>
											</span>
                                </div>
                            </div>

                            <div class="space-4"></div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-4"> 图标 </label>
                                <div class="col-sm-9">
                                    <div class="col-xs-10 col-sm-5">{:UpImage("icon",100,100,$vo['icon'])}</div>
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">仅支持jpg、gif、png、bmp、jpeg，且小于1MB，建议尺寸：100x100。</span>
											</span>
                                </div>
                            </div>

                            <div class="space-4"></div>
                            
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-4"> 会员卡背景 </label>
                                <div class="col-sm-9">
                                    <div class="col-xs-10 col-sm-5">{:UpImage("card_pic",250,140,$vo['card_pic'])}</div>
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">仅支持jpg、gif、png、bmp、jpeg，且小于1MB，建议尺寸：750x420。</span>
											</span>
                                </div>
                            </div>

                            <div class="space-4"></div>
                            
                            
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2"> 会员费 </label>
                                <div class="col-sm-9">
                                    <input type="number" name="price" id="price" placeholder="会员费" class="col-xs-10 col-sm-5"
                                           value="{$vo['price']}">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">会员费不能为空。</span>
											</span>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2"> 每天任务数 </label>
                                <div class="col-sm-9">
                                    <input type="number" name="day_num" id="day_num" placeholder="每天任务数" class="col-xs-10 col-sm-5"
                                           value="{$vo['day_num']}">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">每天任务数不能为空。</span>
											</span>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2"> 有效天数 </label>
                                <div class="col-sm-9">
                                    <input type="number" name="expri_day" id="expri_day" placeholder="有效天数" class="col-xs-10 col-sm-5"
                                           value="{$vo['expri_day']}">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">有效天数不能为空。</span>
											</span>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            
                            
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2"> 一级分佣比列 </label>
                                <div class="col-sm-9">
                                    <input type="number" name="fenyong_1" id="fenyong_1" placeholder="一级任务分佣比列" class="col-xs-10 col-sm-5"
                                           value="{$vo['fenyong_1']}">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">一级任务分佣比列不能为空。</span>
											</span>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            
                            
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2"> 二级分佣比列 </label>
                                <div class="col-sm-9">
                                    <input type="number" name="fenyong_2" id="fenyong_2" placeholder="二级任务分佣奖励" class="col-xs-10 col-sm-5"
                                           value="{$vo['fenyong_2']}">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">二级任务分佣比列不能为空。</span>
											</span>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            
                            
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2"> 一级推荐奖励 </label>
                                <div class="col-sm-9">
                                    <input type="number" name="jiangli_1" id="jiangli_1" placeholder="一级推荐奖励" class="col-xs-10 col-sm-5"
                                           value="{$vo['jiangli_1']}">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">一级推荐奖励不能为空。</span>
											</span>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2"> 二级推荐奖励 </label>
                                <div class="col-sm-9">
                                    <input type="number" name="jiangli_2" id="jiangli_2" placeholder="二级推荐奖励" class="col-xs-10 col-sm-5"
                                           value="{$vo['jiangli_2']}">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">二级推荐奖励不能为空。</span>
											</span>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2"> 开通网红 </label>
                                <div class="control-label no-padding-left col-sm-1">
                                    <label>
                                        <input name="is_red" id="is_red"
                                        <if condition="$vo.is_red eq 1">checked="checked"</if>
                                        value="1" class="ace ace-switch ace-switch-2" type="checkbox" />
                                        <span class="lbl"></span>
                                    </label>
                                </div>
                                <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle"></span>
										</span>
                            </div>
                            <div class="space-4"></div>
                            
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2"> 任务接单 </label>
                                <div class="control-label no-padding-left col-sm-1">
                                    <label>
                                        <input name="is_r" id="is_r"
                                        <if condition="$vo.is_r eq 1">checked="checked"</if>
                                        value="1" class="ace ace-switch ace-switch-2" type="checkbox" />
                                        <span class="lbl"></span>
                                    </label>
                                </div>
                                <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle"></span>
										</span>
                            </div>
                            <div class="space-4"></div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2"> 排序 </label>
                                <div class="col-sm-9">
                                    <input type="number" name="o" id="o" placeholder="排序" class="col-xs-10 col-sm-5"
                                           value="{$vo['o']}">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">越小越靠前。</span>
											</span>
                                </div>
                            </div>
							<div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">
                                    背景色 </label>
                                <div class="col-sm-9">
                                	<div id="cp3b" class="input-group colorpicker-component">
									  <input type="text" name="bg_color" value="{$vo.bg_color}" class="form-control input-lg" <if condition="$vo['bg_color'] eq ''">data-color="#4fc08d"<else/>data-color="{$vo.bg_color}"</if>/>
									  <span class="input-group-addon"><i></i></span>
									</div>


                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="col-md-offset-2 col-md-9">
                                <button class="btn btn-info submit" type="button">
                                    <i class="icon-ok bigger-110"></i>
                                    提交
                                </button>

                                &nbsp; &nbsp; &nbsp;
                                <button class="btn" type="button" onclick="history.back(-1);">
                                    <i class="icon-undo bigger-110"></i>
                                    取消
                                </button>
                            </div>
                        </form>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer"/>

</div><!-- /.main-container -->

<include file="Public/footerjs"/>
<!-- inline scripts related to this page -->
<script type="text/javascript">
    $(function () {
    	$('#cp3b').colorpicker();
        $(".btn-info.submit").click(function () {
            var title = $("#title").val();
            var price = $("#price").val();
            var day_num = $("#day_num").val();
            var expri_day = $("#expri_day").val();
            var fenyong_1 = $("#fenyong_1").val();
            var fenyong_2 = $("#fenyong_2").val();
            var jiangli_1 = $("#jiangli_1").val();
            var jiangli_2 = $("#jiangli_2").val();
            var is_red = $("#is_red").val();
            var is_r = $("#is_r").val();
            var o = $("#o").val();
            if (title == '') {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "等级名称必须填写。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            if (price == '') {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "会员费必须填写。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            if (day_num == '') {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "每天任务数必须填写。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            if (expri_day == '') {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "有效天数必须填写。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            if (fenyong_1 == '') {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "一级任务分佣比列必须填写。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            if (fenyong_2 == '') {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "二级任务分佣比列必须填写。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            if (jiangli_1 == '') {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "一级推荐奖励必须填写。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            if (jiangli_2 == '') {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "二级推荐奖励必须填写。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            if (o == '') {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "排序值必须填写。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            $("#form").submit();
        });
    });

</script>
</body>
</html>
